1. Field of the Invention
The present invention relates to a method and apparatus for measuring a distance, and more particularly to a method and apparatus for optically measuring a distance to an object.
2. Description of the Prior Art
Measurement of a distance from a measuring device to an object is used for various purposes. For example, in a self-running robot, the distance is measured to recognize a surrounding environment. The robot can run while it avoids confrontation with an article based on the measured information.
The distance may be optically measured. One method thereof is a so-called stereoscopic method. This method is briefly explained below.
FIG. 1B illustrates a principle of the stereoscopic method. Numerals 101 and 102 denote lenses having the same focal distance, and numerals 101A and 102A denote optical axes thereof. The lenses 101 and 102 are arranged such that the optical axes 101A and 102A are parallel to each other and a line (base line) connecting centers of the lenses is orthogonal to the optical axes 101A and 102A. Measuring means 103 is arranged behind the lens 101 at a position spaced by the focal distance F of the lens 101, and measuring means 104 is arranged behind the lens 102 at a position spaced by the focal distance F. The measurement means 103 and 104 are arranged on a line which is parallel to the base line of the lenses 101 and 102.
In FIG. 1A, an object 105 to be measured is at an infinite point on the optical axis 101A. In this case, an image 106 of the object 105 on the measurement means 103 by the lens 101 exists on the optical axis 101A, and an image 107 of the object 105 on the measurement means 104 by the lens 102 exists on the optical axis 102A.
In FIG. 1B, the object 105 is at a point on the optical axis 101A spaced from lens 101 by a definite distance X. In this case, the image 106 of the object 105 on the measurement means 103 by the lens 101 exists on the optical axis 101A but the image 107 of the object 105 on the measurement means 104 by the lens 102 exists at a point spaced from the optical axis 102A.
Accordingly, by detecting a deviation D of the image 107 from the optical axis 102A by the measurement means, the distance X to be measured can be calculated in accordance with the following formula based on a distance F between the lenses 101 and 102 and the measurement means 103 respectively and 104, and the base line length L. ##EQU1##
Since the object to be measured usually has an extension, or finite depth, an image is formed over a certain range on the measurement means. As a result, it is difficult to specify the image at the same point on the same object. In the above stereoscopic method, in order to determine the positions of the images 106 and 107 by the measurement means 103 and 104, an illumination distribution in one measurement means 103 is correlated to an illumination distribution in the other measurement means 104.
FIGS. 2A, 2B and 2C illustrate a principle of the correlation method.
The measurement means 103 and 104 may be CCD arrays which are self-scan type sensors. As is well known, the CCD array comprises a number of finely segmented photo-sensing elements of approximately 10 .mu.m, and can produce an electrical signal representing a degree of illumination of the image detected by the photo-sensing elements, as a time-serial signal in a predetermined sequence.
In FIG. 2A, a CCD array 103 which is the measurement means for the lens 101 has n photo-sensing elements, and a CCD array 104 which is the measurement means for the lens 102 has m photo-sensing elements (m&gt;n). When a distance to the object on the optical axis 101A is to be measured, the image 106 formed by the lens 101 exists on the optical axis 101A regardless of the distance to the object but the image 107 formed by the lens 102 changes its position depending on the distance to the object. Accordingly, the CCD array 104 has more photo-sensing elements than the CCD array 103. In this arrangement, the CCD array 103 is called a standard view field and the CCD array 104 is called a reference view field.
In the arrangement of FIG. 2A, illumination distributions of the standard view field and the reference view field are shown in FIG. 2B. Since a focusing relationship of the object 105 and the image 106 in the optical axis direction to the lens 101 is equal to a focusing relationship of the object 105 and the image 107 on the optical axis direction to the lens 102 (magnifications are equal), the illumination distribution of the image 106 and the illumination distribution of the image 107 are different from each other only in the displacement D.
Accordingly, the CCD arrays 103 and 104 time-serially produce outputs of the photo-sensing elements as shown in FIG. 2C.
In order to correlate the outputs of the two CCD arrays, differences between outputs S.sub.1 -S.sub.n of first to n-th photo-sensing elements in the standard view field and corresponding outputs R.sub.1 .about.R.sub.n of first to n-th photo-sensing elements in the reference view field are determined. ##EQU2## Similarly, differences between the outputs S.sub.1 .about.S.sub.n of the first to n-th photo-sensing elements in the standard view field and corresponding outputs R.sub.2 .about.R.sub.n+1 of the second to (n+1)th photo-sensing elements in the reference view field are determined. ##EQU3## Similarly, ##EQU4## is determined.
Of the (m-n+1) values thus determined, the COR number of the smallest value (theoretically zero) is selected and it is multiplied by the width of one photo-sensing element of the CCD array to determine the distance D.
In the determination of the distance D by the correlation method, the standard view field of a certain size and the reference view field larger than the standard view field are necessary.
As seen from the above description, when the distance measurement is to be done over a wide range from an infinite to a near distance, the CCD array for the reference view field is large and requires a large number of photo-sensing elements because the distance D is large in the near distance measurement. This makes the signal processing complex in the correlation method.